<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,maximum-scale=1.0,minimum-scale=1.0">
<title>提问-问答中心</title>
<meta name="description" content="{$eju.field.seo_description}" />
<meta name="keywords" content="{$eju.field.seo_keywords}" />
<link href="{eju:global name='web_cmspath' /}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
{eju:static file="ask/skin/css/ask.css" /}
{eju:static file="/public/static/common/js/jquery.min.js"/}
{eju:static file="/public/plugins/layer-v3.1.0/layer.js"/}
{eju:static file="ask/skin/js/ask.js"/}
{eju:static file="ask/skin/css/AskCommonCss.css" /}
{eju:static file="ask/skin/css/add.css" /}
{eju:static file="ask/skin/css/navigation20141112.css" /}
{eju:static file="skin/css/news.css" /}
{eju:static file="skin/css/list_news.css" /}
{eju:static file="skin/js/flexible.js" /}
{eju:static file="skin/js/jquery.form.js" /}
</head>
<body>
<div class="header" style="position: inherit;">
  <div class="go-back"> <a href="javascript:void(0)" onClick="history.back(-1)"> <span class="ico ico-return">返回上一页</span> </a> </div>
  <div class="h-name"><span class="text">问答</span></div>
  <ul class="h-menu">
    <li><a href="javascript:;" id="navBtn" style="display: block;"><img src="{eju:global name='web_templets_mobile' /}/skin/images/nav.png"></a></li>
  </ul>
</div>
<!--nav end--> 
<script type="text/javascript">
    window.UEDITOR_HOME_URL = "__ROOT_DIR__/public/plugins/Ueditor/";
</script>
{eju:static file="/public/plugins/Ueditor/ueditor.config.js"/}
{eju:static file="/public/plugins/Ueditor/ueditor.all.min.js"/}
{eju:static file="/public/plugins/Ueditor/lang/zh-cn/zh-cn.js"/}
<div class="askBox-area s2" style="display:block;">
    <div class="ask-intro">
        <h3>请描述您的问题 <span class="f12">（必填）</span></h3>
        <div class="input-wrapper">
            <div class="inputBox" style="border: 1px solid#ddd;border-radius: 2px;padding: 13px 18px;height: 46px;">
                <input style="    border: none;display: block;float: left; width: 220px;overflow: hidden;font-size: 14px;outline: 0;height: 18px;line-height: 18px;}" type="text"  name="title" id="title" placeholder="最少输入6个字哦~" class="input-cont" />
                <!--<span class="input-count"><em id="asktitlenum">0</em>/50</span>-->
            </div>
        </div>
    </div>
    <div class="supply-cont clearfix" style="margin-top: 5px;">
        <div class="supply-btnbox clearfix">
            <div class="supply-btn" id="showsupplementcontext"> 问题描述</div>
        </div>
        <div class="supply-area" id="supplementcontext" style="padding: 0px 0px 0px 0px;">
            <textarea placeholder="请输入补充内容" class="span12 ckeditor" id="content" name="content" style="width: 75%;"></textarea>
        </div>
    </div>
    <div style="height: 30px;">
        <a style="display: block;float: right;border-radius: 4px;width: 120px;height: 32px;line-height: 32px;text-align: center;color: #fff;font-size: 14px;margin: 10px 0 0 0;background: #ff5200;" href="javascript:void(0);" class="btn-submit" data-url="{$eju.field.SubmitAddAsk}" onClick="SubmitData(this);">提交问题</a>
    </div>
</div>
<script type="text/javascript">
    UE.getEditor('content',{
        serverUrl :"{:url('user/Uploadify/index',array('savepath'=>'weapp'))}",
        zIndex: 1,
        initialFrameWidth: "135%", //初化宽度
        initialFrameHeight: 300, //初化高度
        focus: false, //初始化时，是否让编辑器获得焦点true或false
        maximumWords: 99999,
        removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
        pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
        autoHeightEnabled: false,
        toolbars: [["forecolor", "backcolor", "removeformat", "|", "simpleupload", "unlink"]],
    });

    //必须在提交前渲染编辑器；
    function content() {
        //判断编辑模式状态:0表示【源代码】HTML视图；1是【设计】视图,即可见即所得；-1表示不可用
        if(UE.getEditor("content").queryCommandState('source') != 0) {
            UE.getEditor("content").execCommand('source'); //切换到【设计】视图
        }
    }
</script>
<script type="text/javascript">
    function layer_loading(msg){
        var loading = layer.msg(
            msg+'...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请勿刷新页面',
            {
                icon: 1,
                time: 3600000, //1小时后后自动关闭
                shade: [0.2] //0.1透明度的白色背景
            });
        //loading层
        var index = layer.load(3, {
            shade: [0.1,'#fff'] //0.1透明度的白色背景
        });

        return loading;
    }
    function SubmitData(obj) {
        if (!$('#title').val()) {
            layer.msg('请填写问题标题！', {time: 1500, icon: 2});
            $('#title').focus();
            return false;
        }
        if (!UE.getEditor("content").getContent()) {
            layer.msg('请填写问题描述！', {time: 1500, icon: 2});
            return false;
        }
        var aid = $('#aid').val();
        var title = $('#title').val();
        var content = UE.getEditor("content").getContent();
        layer_loading('正在处理');
        $.ajax({
            url: $(obj).data('url'),
            data: {aid:aid,title:title,content:content},
            type:'post',
            dataType:'json',
            success:function(res){
                layer.closeAll();
                if (1 == res.code) {
                    layer.msg(res.msg, {time: 1000},function(){
                        window.location.href = res.url;
                    });
                } else {
                    layer.msg(res.msg, {time: 1500, icon: 2});
                }
            },
            error : function() {
                layer.closeAll();
                layer.alert('网络失败，请刷新页面后重试', {icon: 5, closeBtn: 0});
            }
        });
    }
</script> 
{eju:static file="skin/js/flexslider-min.js" /}
<div class="nav sFix">
  <ul>
    {eju:navig position_id='6' type='top' currentstyle="active" id="field"}
    <li><a href="{$field.navig_url}" {$field.target} {$field.nofollow}>
      <p><img src="{eju:global name='web_templets_mobile' /}/skin/images/nav_x{$field.navig_id}.png" alt="{$field.navig_name}"></p>
      {$field.navig_name}</a></li>
    {/eju:navig}
  </ul>
  <div class="fixMask"></div>
</div>
{eju:static file="skin/js/echo.min.js" /}
{eju:static file="skin/js/index.js" /} 
{eju:static file="skin/css/box_news.css" /}
</body>
</html>
